"""
Author        yongfa
Date          2021-05-27 20:04:20
LastEditTime  2023-07-10 11:13:51
LastEditors   yongfa
Description   请求参数
"""


from flask_restx import reqparse, inputs
from app.extensions.utils.parameters import page_params


get_list_params = page_params.copy()
get_list_params.add_argument('value', type=str, location='args', trim=True, help='数值')
get_list_params.add_argument('label', type=str, location='args', trim=True, help='标识')
get_list_params.add_argument('level', type=int, location='args', trim=True, help='级别')
get_list_params.add_argument('parent_id', type=int, location='args', trim=True, help='父id')


get_tree_params = reqparse.RequestParser()
get_tree_params.add_argument('type_id', type=int, location='args', trim=True, help='类型id')
get_tree_params.add_argument('parent_id', type=int, trim=True, location='args', help='父id')


dict_type_list_params = get_list_params.copy()


dict_type_params = reqparse.RequestParser()
dict_type_params.add_argument('value', type=str, trim=True, required=True, location='json', help='数值')
dict_type_params.add_argument('label', type=str, trim=True, required=True, location='json', help='标识')
dict_type_params.add_argument('parent_id', type=int, trim=True, location='json', help='父id')
dict_type_params.add_argument('status', type=inputs.boolean, trim=True, location='json', help='状态')
dict_type_params.add_argument('remark', type=str, trim=True, location='json', help='备注')


dict_list_params = get_list_params.copy()
dict_list_params.add_argument('type_id', type=int, location='args', trim=True, help='类型id')


dict_params = reqparse.RequestParser()
dict_params.add_argument('value', type=str, trim=True, required=True, location='json', help='数值')
dict_params.add_argument('label', type=str, trim=True, required=True, location='json', help='标识')
dict_params.add_argument('parent_id', type=int, trim=True, location='json', help='父id')
dict_params.add_argument('type_id', type=int, trim=True, location='json', help='类型id')
dict_params.add_argument('nums', type=int, trim=True, location='json', help='数量')
dict_params.add_argument('level', type=int, trim=True, location='json', help='级别')
dict_params.add_argument('css_class', type=str, trim=True, location='json', help='样式')
dict_params.add_argument('list_class', type=str, trim=True, location='json', help='列表样式')
dict_params.add_argument('is_default', type=inputs.boolean, trim=True, location='json', help='默认')
dict_params.add_argument('status', type=inputs.boolean, trim=True, location='json', help='状态')
dict_params.add_argument('sort', type=int, trim=True, location='json', default=0, help='排序')
dict_params.add_argument('remark', type=str, trim=True, location='json', help='备注')


dicts_params = {
    'get_tree_params': get_tree_params,
    'dict_type_list_params': dict_type_list_params,
    'dict_type_params': dict_type_params,
    'dict_list_params': dict_list_params,
    'dict_params': dict_params,
}
